from rest_framework import serializers
from .models import Category,Article

class BigCategorySerializer(serializers.Serializer):
    id = serializers.IntegerField()
    name = serializers.CharField(read_only=True,max_length=20)
    slug = serializers.SlugField()


class CategorySerializer(serializers.ModelSerializer):
    class Meta:
        model = Category
        fields = ('id','name','slug','bigcategory')



class KeyWordSerializer(serializers.Serializer):
    id = serializers.IntegerField()
    name = serializers.CharField(read_only=True,max_length=20)


class TagSerializer(serializers.Serializer):
    id = serializers.IntegerField()
    name = serializers.CharField(read_only=True, max_length=32)
    slug = serializers.SlugField()


class ArticleSerializer(serializers.ModelSerializer):
    class Meta:
        model = Article
        fields = ('__all__')

